﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Test1.Models;
using Test1.Repositorys;
using System.Linq.Expressions;
namespace Test1.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            var dataContext = new LoginLinqDataContext();

            Repository<T_userinfo> t_u = new Repository<T_userinfo>(dataContext);
            Func<T_userinfo, bool> expr = c => c.id>=1;
            var userinfo = t_u.FindAll(expr);

            T_UserRepository t_user = new T_UserRepository(dataContext);
            var users=t_user.GetAllUserById(2);
            return View(userinfo);
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
